﻿<div>
    <div class="form-inline pull-right">
        <button class="btn btn-info waves-effect" ng-click="list.GetPageData(paginationConf.currentPage, paginationConf.itemsPerPage);">
            <span class="glyphicon glyphicon-refresh"></span>
        </button>
        <div class="input-group">
            <span class="input-group-addon">全局搜索：</span>
            <div class="fg-line">
                <input type="text" class="form-control" ng-change="search(kw)" ng-model="kw" placeholder="全局搜索" />
            </div>
        </div>
        <div class="input-group">
            <span class="input-group-addon">分类：</span>
            <div class="ui search selection dropdown category">
                <input name="category" type="hidden" id="category">
                <i class="dropdown icon"></i>
                <div class="default text">请选择分类</div>
                <div class="menu">
                    <div class="item"data-value="">无</div>
                    <div class="item" ng-repeat="item in cat track by $index" data-value="{{item.Id}}">{{item.Name}}</div>
                </div>
            </div>
        </div>
        <div class="input-group">
            <span class="input-group-addon">服务端排序方式：</span>
            <div class="ui selection dropdown orderby">
                <input name="gender" type="hidden" value="default">
                <i class="dropdown icon"></i>
                <div class="text">最后修改</div>
                <div class="menu">
                    <div class="item" data-value="0">发表时间</div>
                    <div class="item" data-value="1">最后修改</div>
                    <div class="item" data-value="2">访问量最多</div>
                    <div class="item" data-value="4">支持数最多</div>
                    <div class="item" data-value="5">每日平均访问量</div>
                </div>
            </div>
        </div>
    </div>
    <table ng-table="list.tableParams" class="table table-bordered table-hover table-condensed listTable" ng-form="list.tableForm" tracked-table="list.tableTracker">
        <tr ng-repeat="row in $data" ng-form="rowForm" tracked-table-row="row">
            <td title="'标题'">
                <a ng-href="/{{row.Id}}" target="_blank">{{row.Title}}</a>
            </td>
            <td title="'作者'">
                <a ng-href="/author/{{row.Author}}" target="_blank">{{row.Author}}</a>
            </td>
            <td title="'作者邮箱'">
                {{row.Email}}
            </td>
            <td title="'阅读'">
                {{row.ViewCount}}
            </td>
            <td title="'发表'">
                {{row.PostDate|date:'yyyy-MM-dd HH:mm:ss'}}
            </td>
            <td title="'修改'">
                {{row.ModifyDate|date:'yyyy-MM-dd HH:mm:ss'}}
            </td>
            <td title="'修改次数'">
                {{row.ModifyCount}}
            </td>
            <td title="'分类'">
                {{row.CategoryName}}
            </td>
            <td title="'标签'">
                {{row.Label}}
            </td>
            <td title="'支持'">
                {{row.VoteUpCount}}
            </td>
            <td title="'状态'">
                {{row.Status}}
            </td>
            <td title="'禁止评论'">
                <label class="el-switch">
                    <input type="checkbox" name="switch" ng-checked="row.DisableComment">
                    <span class="el-switch-style" ng-click="toggleDisableComment(row)"></span>
                </label>
            </td>
            <td title="'禁止转载'">
                <label class="el-switch">
                    <input type="checkbox" name="switch" ng-checked="row.DisableCopy">
                    <span class="el-switch-style" ng-click="toggleDisableCopy(row)"></span>
                </label>
            </td>
            <td title="'操作'" style="width: 126px;">
                <div class="btn-group">
                    <button class="btn btn-default btn-sm waves-effect" ng-click="list.pass(row)" ng-if="row.Status=='审核中'">
                        <i class="icon-checkmark"></i>
                    </button>
                    <a class="btn btn-success btn-sm waves-effect" ng-href="#/post/edit?id={{row.Id}}">
                        <i class="icon-pencil"></i>
                    </a>
                    <button class="btn btn-danger btn-sm waves-effect" ng-click="list.del(row)" ng-if="row.Status!='已删除'">
                        <i class="icon-bin"></i>
                    </button>
                    <a class="btn btn-danger btn-sm waves-effect" ng-click="list.truncate(row)" ng-if="row.Status=='已删除'">
                        <i class="icon-cross"></i>
                    </a>
                    <a class="btn btn-info btn-sm waves-effect" ng-click="list.restore(row)" ng-if="row.Status=='已删除'">
                        <i class="icon-undo2"></i>
                    </a>
                    <a class="btn  btn-sm waves-effect" ng-class="{true:'btn-success',false:'btn-primary'}[row.IsFixedTop]" ng-click="list.fixtop(row.Id)" ng-if="row.Status!='已删除'">
                        <i class="icon-pushpin" ng-class="{true:'text-danger'}[row.IsFixedTop]"></i>
                    </a>
                </div>
            </td>
        </tr>
    </table>
    <tm-pagination conf="paginationConf"></tm-pagination>
</div>